home *** CD-ROM | disk | FTP | other *** search
/ MacFormat UK 160 - Disc 2 / MF_UK_160_2.iso / pc / DiscContent / Trials / oxygen / samples / debugger / Nodeset functions / sample2.xsl < prev   
Encoding:
Extensible Markup Language  |  2005-07-21  |  1.1 KB  |  31 lines

  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!--    Category:    Nodeset functions
  3.     Sample from Zvon XSLT tutorial (www.zvon.org)  
  4.     Description:    An example of id function usage. -->
  5. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  6.     <xsl:output method="html"/>
  7.     <xsl:template match="/">
  8.         <xsl:apply-templates select="//doc"/>
  9.         <HR/>
  10.         <xsl:for-each select="//ref">
  11.             <xsl:apply-templates select="id(@id)">
  12.                 <xsl:with-param name="nmbr">
  13.                     <xsl:value-of select="position()"/>
  14.                 </xsl:with-param>
  15.             </xsl:apply-templates>
  16.         </xsl:for-each>
  17.     </xsl:template>
  18.     <xsl:template match="ref">
  19.         <SUP>
  20.             <xsl:value-of select="count(//doc/*) - count(following::ref)"/>
  21.         </SUP>
  22.     </xsl:template>
  23.     <xsl:template match="note">
  24.         <xsl:param name="nmbr">1</xsl:param>
  25.         <DIV>
  26.             <xsl:number value="$nmbr" format="1. "/>
  27.             <xsl:value-of select="."/>
  28.         </DIV>
  29.     </xsl:template>
  30. </xsl:stylesheet>
  31.